To create an off screen rendering area, first create an X Pixmap of the depth specified by the desired Visual, then call
GLXPixmap glXCreateGLXPixmap ( Display *dpy , XVisualInfo* visual , Pixmap Pixmap ) ;
glXCreateGLXPixmap creates an off screen rendering area and returns its XID. Any GLX rendering context created with respect to visual can be used to render into this off screen area.
pixmap is used as the front-left buffer of the resulting off screen rendering area. All other ancillary buffers specified by visual are created without externally visible names. GLX pixmaps may be created with a visual that includes back buffers and stereoscopic buffers. However, glXSwapBuffers is ignored for these pixmaps.
A direct rendering context might not be able to be made current with a GLXPixmap.
If the depth of pixmap does not match the GLX _BUFFER _SIZE attribute of visual, or if Pixmap was not created with respect to the same screen as visual, then a BadMatch error is generated. If visual is not valid (e.g., if GLX does not support it), then a BadValue error is generated. If Pixmap is not a valid pixmap id, then a BadPixmap error is generated. Finally, if the server cannot allocate the new GLX pixmap, a BadAlloc error is generated.
A GLXPixmap is destroyed by calling
void glXDestroyGLXPixmap ( Display *dpy , GLXPixmap pixmap ) ;
This request deletes the association between the resource ID pixmap and the GLX pixmap. The storage will be freed when it is not current to any client.
If pixmap is not a valid GLX pixmap then a GLXBadPixmap error is generated.